package com.xyf.sys.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
@Data
public class OrderAddress {

    private Long id;

    private String name;

    private String mobile;

    private String orderId;

    private String userId;

    private String orderProductId;

    private String country;

    private String province;

    private String city;

    private String area;

    private String town;

    private String address;

    private String code;

    private String company;

    private String source;

    @ApiModelProperty("1 寄件地址 2 收件地址 3 团长收件地址 4 商户地址")
    private Integer type;

    private String realId;

    private String realName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastUpdateTime;

    private String status;

    private String delFlag;

    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private String remark;

    public String getTown() {
        return town == null ? "" : town.trim();
    }

    public String getMobile() {
        return mobile == null ? "" : mobile.replaceAll(" ","");
    }

    public String getName() {
        return name == null ? null : name.trim();
    }

    public String getRealName() {
        return realName == null ? null : realName.trim();
    }
}